package com.yc.sole.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.yc.sole.common.enums.CommonState;
import com.yc.sole.common.enums.MenuType;
import jakarta.persistence.*;
import lombok.Data;

/**
 * 对象
 *
 * @author yizuomin
 * @date 2023-03-26
 **/
@Data
@Entity
@Table(name = "sys_menu")
@TableName(value = "sys_menu")
public class Menu {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    /**
     * 菜单名称
     */
    @Column(columnDefinition = "VARCHAR(50) NOT NULL COMMENT '菜单名称'")
    private String menuName;
    /**
     * 上级菜单id
     */
    @Column(columnDefinition = "BIGINT NOT NULL DEFAULT 0 COMMENT '上级菜单id'")
    private Long parentId;
    /**
     * 菜单类型 0菜单 1按钮
     */
    @Column(columnDefinition = "TINYINT(1) NOT NULL COMMENT '菜单类型 0菜单 1按钮'")
    private MenuType menuType;
    /**
     * 菜单路径/权限字符
     */
    @Column(columnDefinition = "VARCHAR(255) NOT NULL COMMENT '菜单路径/权限字符'")
    private String path;
    /**
     * 图标
     */
    @Column(columnDefinition = "VARCHAR(50) COMMENT '图标'")
    @TableField(updateStrategy = FieldStrategy.ALWAYS)
    private String icon;
    /**
     * 状态 0无效 1有效
     */
    @Column(columnDefinition = "TINYINT(1) NOT NULL COMMENT '状态 0无效 1有效'")
    private CommonState state;
    /**
     * 排序
     */
    @Column(columnDefinition = "INT NOT NULL COMMENT '排序'")
    private Integer sort;
}
